#include "IAlivetimer.h"

IAlivetimer::IAlivetimer(real aliveTime)
{
    timer.recordTimePoint();
}

void IAlivetimer::setAliveTime(real val)
{
    aliveTime = val;
    timer.recordTimePoint();
}

real IAlivetimer::getAliveTime()
{
    return aliveTime;
}

bool IAlivetimer::elapsed()
{
    return aliveTime>0 && timer.getElapsedDoubleSeconds() > aliveTime;
}
